﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BLL;

public partial class WelCome : System.Web.UI.Page
{
    Authentication dllAuthentication = new Authentication();
    protected void Page_Load(object sender, EventArgs e)
    {
        Model.UserInfo objUserInfo = new Model.UserInfo();
        if (objUserInfo.UserName == "admin")
        {
            Utility.HttpHelp.redirectPage("WelcomeAdmin.aspx");
        }
        int _display = dllAuthentication.IsManager(objUserInfo.UserName);
        if (_display == 0)
        {
            Utility.HttpHelp.redirectPage("WelcomeUser.aspx");
        }
        #region 弹出提醒
        PopupManager dllPopupManager = new PopupManager();
        string _info = dllPopupManager.getPopupInfo();
        if (_info.Length > 0)
        {
            ShowMessage(_info);
        }
        #endregion
    }

    /// <summary>
    /// 弹出小窗体事件
    /// </summary>
    /// <param name="msg"></param>
    public void ShowMessage(string msg)
    {
        EeekSoft.Web.PopupWin pop = new EeekSoft.Web.PopupWin();
        this.Controls.Add(pop);
        pop.Text = msg;
        pop.Message = msg;
        pop.Title = System.Configuration.ConfigurationManager.AppSettings["CompanyName"].ToString();
        pop.WindowScroll = true;
        pop.HideAfter = 99999999;
        pop.DockMode = EeekSoft.Web.PopupDocking.BottomLeft;
        pop.OffsetX = int.Parse(Session["_width"].ToString()) - 338; 
        pop.ActionType = EeekSoft.Web.PopupAction.MessageWindow;
        pop.OffsetY = 1;
        pop.Width = 220;
        pop.Height = 170;
    }

    
}
